public class StringStack
{
	String meinStack[] = new String[20];
	int counter = -1;

	// runternehmen
	public String pop()
	{
		if (isEmpty())
		{
			return null;
		}

		counter--;

		return meinStack[counter + 1];
	}

	// drauflegen
	public void push(String s)
	{
		if (counter == meinStack.length - 1)
		{
			enlargeStack();
		}

		counter++;

		meinStack[counter] = s;
	}

	private void enlargeStack()
	{
		String[] meinStack2 = new String[meinStack.length * 2];

		for (int i = 0; i < meinStack.length; i++)
		{
			meinStack2[i] = meinStack[i];
		}

		meinStack = meinStack2;
	}

	public boolean isEmpty()
	{
		if (counter == -1)
		{
			return true;
		} else
		{
			return false;
		}
	}
}
